package com.wang.helloworld.zookeeper;

import org.apache.zookeeper.WatchedEvent;
import org.apache.zookeeper.Watcher;
import org.apache.zookeeper.Watcher.Event.KeeperState;

public class ZookeeperWatcher implements Watcher{
	public void process(WatchedEvent event) {
		if(0 == event.getState().compareTo(KeeperState.Disconnected))
		{
			System.out.println("Connection is disconnected");
		}
		else
		{
			System.out.println("Event: " + event.toString());
		}
	}
}
